package com.laikan.reader.bookfriend.fragment.impl;

import com.laikan.reader.R;
import com.laikan.reader.bookfriend.adapter.BaseListAdapter;
import com.laikan.reader.bookfriend.adapter.impl.ShorteAdapter;
import com.laikan.reader.bookfriend.adapter.support.impl.ShorteSupport;
import com.laikan.reader.bookfriend.entity.PageAutherBean;
import com.laikan.reader.bookfriend.fragment.AutherFragment;
import com.laikan.reader.bookfriend.requester.AutherRequester;
import com.socks.library.KLog;


/**
 * Created by lingyt on 2016/11/15.
 * 看点页
 *
 *
 * */
public class ShorteFragment extends AutherFragment {

    @Override
    protected BaseListAdapter getAdapter() {
        return new ShorteAdapter(getActivity(), R.layout.view_item_template_img_right,new ShorteSupport());
    }

    @Override
    protected void loadData(int pageNo) {
        KLog.w(args,"load Data:开始加载第 "+pageNo+" 页数据");
        String authorId = getAuthorId();
        int bookPageNo = 1;
        AutherRequester.requestAutherHomeData(authorId,bookPageNo,pageNo,mCallback);
    }

    @Override
    public void refreshFragmentData() {
        PageAutherBean bean = (PageAutherBean) getFragmentData();
        mState = checkData(bean.data.shorteList);
        showData(bean.data.shorteList);
    }
}
